

package com.api.oa.services;

import com.api.oa.exception.BadRequestException;
import com.api.oa.model.entity.YQInsEntity;
import com.api.oa.model.vo.YQInsEntityVO;
import com.github.pagehelper.PageInfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public interface YQInsEntityService {


    Integer add(YQInsEntity entity) throws Exception;


    Integer addBatch(List<YQInsEntity> entities) throws BadRequestException;


    void remove(String id);


    Integer update(YQInsEntity org);


    PageInfo<YQInsEntityVO> list(Long pid, Integer pageIndex, Integer pageSize);


    YQInsEntity one(String id);


    PageInfo<YQInsEntityVO> page(String insCode, String orgId, Integer pageIndex, Integer pageSize);


    /**
     * 远程查询
     * @param insName
     * @return
     */
    List<YQInsEntityVO> search(String insName);

    /**
     * Android查询
     * @param insCode
     * @param orgId
     * @param pageIndex
     * @param pageSize
     * @return
     */
    PageInfo<YQInsEntityVO> androidPage(String insCode, String orgId, Integer pageIndex, Integer pageSize);


    /**
     * 网格下的分类
     * @param id
     * @return
     */
    List<YQInsEntityVO> listInsByOrgId(String id) throws Exception;


    /**
     * 导出
     * @param insCode
     * @param orgId
     * @param pageIndex
     * @param pageSize
     * @param res
     */
    void export(String insCode, String orgId, Integer pageIndex, Integer pageSize, HttpServletResponse res) throws IOException;
}
